Skip to content

Support selected .NET 11 SDK features and document support decisions - #560

Merged
jongalloway merged 1 commit into
mainfrom
jongalloway-net-11-feature-support
Nov 5, 2026
Merged

jongalloway merged 1 commit into
mainfrom
jongalloway-net-11-feature-support

Conversation

@jongalloway

Copy link
Copy Markdown
Owner

Why

.NET 11 adds useful CLI capabilities that the existing MCP tools do not expose. This completes the evaluation epic with a bounded set of low-cost additions, preserves existing defaults, and tracks larger feature work separately.

Fixes: #547

Approach

  • Add explicit solution-filter creation and membership management without changing solution discovery or the default .sln format.
  • Support safely quoted application environment variables in foreground/background Run, framework selection in Format, and prerelease template installation with exact-version precedence preserved.
  • Honor SDK-supported DOTNET_TEST_RUNNER precedence and keep explicit runner overrides local to the child process. Check the active CLI SDK rather than the server's target framework.
  • Document xUnit v3/NUnit-on-MTP creation through existing template options, SDK-owned behavior, and decisions for the remaining features.

Follow-up implementation issues: test controls/artifacts (#557), file-based apps (#558), watch/device/Aspire lifecycle (#559), and NuGet source publication-age policy (#556). The full feature decision record is attached to #547.

SDK-specific considerations

RC3's filter Remove command can exit successfully without removing entries when the filter and parent are in different directories. Filter removal therefore validates and updates JSON membership directly, preserves unrelated properties, retains confirmation, and uses an adjacent temporary file plus atomic replacement.

RC3's MTP test templates reject an explicit net10.0 target despite advertising it in help. Examples explicitly select net11.0 and explain that template post-actions can update global.json even with --no-restore.

Validation

  • Both net10.0 and net11.0 server targets build with zero warnings/errors.
  • Affected tests and real stdio MCP scenarios: 580 passed, 0 failed, 2 skipped across both targets. The skips are the existing opt-in interactive NuGet-cache-clear test.
  • Verified real filter files and membership, foreground/background environment values, target-specific formatting, local-feed template version selection, runner precedence with SDK 10 compatibility, Configuration defaults, NETSDK1235, and tool discovery schemas.

No dependency upgrades or tool-manifest changes.

Add solution filters, Run environment variables, Format framework selection, prerelease template installs, and SDK-aware test runner detection. Preserve existing defaults and document verified RC3 behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 5, 2026 07:28
{
foreach (var (prerelease, explicitVersion, expected) in new[]
{
(false, (string?)null, "1.0.0"),
foreach (var (prerelease, explicitVersion, expected) in new[]
{
(false, (string?)null, "1.0.0"),
(true, (string?)null, "2.0.0-preview.1"),
{
(false, (string?)null, "1.0.0"),
(true, (string?)null, "2.0.0-preview.1"),
(true, (string?)"1.0.0", "1.0.0")
Comment on lines +1314 to +1316
(effectiveRunner, selectionSource) = SdkIntegration.TestRunnerDetector.DetectTestRunner(
workingDirectory: projectDir, projectPath: project, logger: _logger,
supportsEnvironmentRunner: supportsEnvironmentRunner);
@jongalloway
jongalloway merged commit a74ccb3 into main Nov 5, 2026
22 checks passed
@jongalloway
jongalloway deleted the jongalloway-net-11-feature-support branch November 5, 2026 07:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Concurrent filter removals can silently overwrite each other, and environment secrets can leak through logs and returned commands even when unsafe output is disabled.

4 open issues
What changed in this PR

Adds selected .NET 11 SDK capabilities to the existing MCP tools while preserving defaults and documenting deferred work from #547.

Changes:

  • Adds explicit solution-filter creation and membership management.
  • Exposes Run environment variables, Format framework selection, prerelease template installation, and SDK-aware test-runner precedence.
  • Adds feature, schema, and stdio scenario tests, plus usage and support-decision documentation.
File Description
README.md Documents new options, compatibility, and examples.
DotNetMcp/​Tools/​Sdk/​DotNetCliTools.Sdk.Consolidated.cs Adds prerelease template installation.
DotNetMcp/​Tools/​Cli/​DotNetCliTools.Solution.cs Adds solution filters and JSON-based membership removal.
DotNetMcp/​Tools/​Cli/​DotNetCliTools.Project.Consolidated.cs Routes new project options and test-runner overrides.
DotNetMcp/​Tools/​Cli/​DotNetCliTools.Misc.cs Adds framework selection to Format.
DotNetMcp/​SdkIntegration/​TestRunnerDetector.cs Adds environment-based runner detection.
DotNetMcp/​Execution/​SdkFeatureSupport.cs Checks active SDK support for opt-ins.
DotNetMcp/​Execution/​DotNetCommandExecutor.cs Applies child-process test-runner overrides.
DotNetMcp/​Execution/​CommandLineArgument.cs Adds command-argument quoting.
DotNetMcp.Tests/​Tools/​Sdk11FeatureTests.cs Tests features and compatibility behavior.
DotNetMcp.Tests/​Server/​ToolAnnotationTests.cs Checks discovery metadata for new parameters.
DotNetMcp.Tests/​Scenarios/​Sdk11FeatureScenarioTests.cs Adds stdio scenarios for templates, Run, and filters.
doc/​sdk-integration.md Explains SDK gating, implementation choices, and deferred work.
doc/​error-diagnostics.md Documents NETSDK1235 warning behavior.
doc/​ai-assistant-guide.md Maps supported features to MCP arguments.

Review effort: Balanced

if (noBuild) args.Append(" --no-build");
if (environmentVariables is not null)
foreach (var (name, value) in environmentVariables)
args.Append($" --environment {CommandLineArgument.Quote($"{name}={value}")}");
Comment on lines +192 to +195
if (await File.ReadAllTextAsync(filterPath, cancellationToken) != originalContent)
return "Error: The solution filter changed during removal. No changes were made; retry with the current file.";
cancellationToken.ThrowIfCancellationRequested();
File.Replace(temporaryPath, filterPath, destinationBackupFileName: null);
if (includeGenerated) args.Append(" --include-generated");
if (!string.IsNullOrEmpty(diagnostics)) args.Append($" --diagnostics {diagnostics}");
if (!string.IsNullOrEmpty(severity)) args.Append($" --severity {severity}");
if (!string.IsNullOrEmpty(framework)) args.Append($" --framework {framework}");
Comment on lines +1264 to +1266
var (major, sdkError) = await SdkFeatureSupport.GetMajorVersionAsync(_logger);
if (sdkError is not null)
return sdkError;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Evaluate new .NET 11 SDK features for support (epic)

3 participants